{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录表</title>
    <script src="{% static "js/jquery.min.js" %}"></script>
    <link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse"
                data-target="#example-navbar-collapse">
            <span class="sr-only">切换导航</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">用户反馈</a>
    </div>
    <div class="collapse navbar-collapse" id="example-navbar-collapse">
        <ul class="nav navbar-nav">
            <li class="active"><a href="#">登录</a></li>
            <li><a href="#">注册</a></li>
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    J <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="#">jmeter</a></li>
                    <li><a href="#">EJB</a></li>
                    <li><a href="#">Jasper Report</a></li>

                </ul>
            </li>
        </ul>
    </div>
    </div>
</nav>
<form action="#" method="post" id="fer">
    {% if error %}
            <div class="alert alert-danger" role="alert">
                 <strong>提示：</strong> {{ error }}
            </div>
        {% endif %}

    <label>用户名:</label><input name="username" type="text" required><br>
    <label>密&#x3000码:</label><input name="password" type="password" required><br>
    <a href="/form/regis/">用户注册</a><br>
    <button onclick="roots_entry()">用户登录</button>
    <button onclick="sup_root()">管理员登录</button>
    {% csrf_token %}
</form>


</body>
<script type="text/javascript">
    function roots_entry() {
        $.get("/ajax/", function () {
            $("#fer").attr('action', '/form/login/')
        })
    }
    function sup_root() {
        {#        $.get("/ajax/", function () {#}
        $("#fer").attr('action', '/form/sup/')

        {#        })#}

    }
</script>
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</html>